﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package org.aswing {
    import org.aswing.geom.*;
    import org.aswing.plaf.*;
    import org.aswing.graphics.*;
    import org.aswing.util.*;

    public class UIDefaults extends HashMap {

        override public function put(_arg1, _arg2){
            var _local3:* = ((_arg2)==null) ? super.remove(_arg1) : super.put(_arg1, _arg2);
            return (_local3);
        }
        public function putDefaults(_arg1:Array):void{
            var _local3:*;
            var _local2:Number = 0;
            while (_local2 < _arg1.length) {
                _local3 = _arg1[(_local2 + 1)];
                if (_local3 == null){
                    super.remove(_arg1[_local2]);
                } else {
                    super.put(_arg1[_local2], _local3);
                };
                _local2 = (_local2 + 2);
            };
        }
        public function getUI(_arg1:Component):ComponentUI{
            var _local2:ComponentUI = (this.getInstance(_arg1.getUIClassID()) as ComponentUI);
            if (_local2 == null){
                _local2 = (this.getCreateInstance(_arg1.getDefaultBasicUIClass()) as ComponentUI);
            };
            return (_local2);
        }
        public function getBoolean(_arg1:String):Boolean{
            return ((this.get(_arg1) == true));
        }
        public function getNumber(_arg1:String):Number{
            return ((this.get(_arg1) as Number));
        }
        public function getInt(_arg1:String):int{
            return ((this.get(_arg1) as int));
        }
        public function getUint(_arg1:String):uint{
            return ((this.get(_arg1) as uint));
        }
        public function getString(_arg1:String):String{
            return ((this.get(_arg1) as String));
        }
        public function getBorder(_arg1:String):Border{
            var _local2:Border = (this.getInstance(_arg1) as Border);
            if (_local2 == null){
                _local2 = EmptyUIResources.BORDER;
            };
            return (_local2);
        }
        public function getIcon(_arg1:String):Icon{
            var _local2:Icon = (this.getInstance(_arg1) as Icon);
            if (_local2 == null){
                _local2 = EmptyUIResources.ICON;
            };
            return (_local2);
        }
        public function getGroundDecorator(_arg1:String):GroundDecorator{
            var _local2:GroundDecorator = (this.getInstance(_arg1) as GroundDecorator);
            if (_local2 == null){
                _local2 = EmptyUIResources.DECORATOR;
            };
            return (_local2);
        }
        public function getColor(_arg1:String):ASColor{
            var _local2:ASColor = (this.getInstance(_arg1) as ASColor);
            if (_local2 == null){
                _local2 = EmptyUIResources.COLOR;
            };
            return (_local2);
        }
        public function getFont(_arg1:String):ASFont{
            var _local2:ASFont = (this.getInstance(_arg1) as ASFont);
            if (_local2 == null){
                _local2 = EmptyUIResources.FONT;
            };
            return (_local2);
        }
        public function getInsets(_arg1:String):Insets{
            var _local2:Insets = (this.getInstance(_arg1) as Insets);
            if (_local2 == null){
                _local2 = EmptyUIResources.INSETS;
            };
            return (_local2);
        }
        public function getStyleTune(_arg1:String):StyleTune{
            var _local2:StyleTune = (this.getInstance(_arg1) as StyleTune);
            if (_local2 == null){
                _local2 = EmptyUIResources.STYLE_TUNE;
            };
            return (_local2);
        }
        public function getConstructor(_arg1:String):Class{
            return ((this.get(_arg1) as Class));
        }
        public function getInstance(_arg1:String){
            var _local2:* = this.get(_arg1);
            if ((_local2 is Class)){
                return (this.getCreateInstance((_local2 as Class)));
            };
            return (_local2);
        }
        private function getCreateInstance(_arg1:Class):Object{
            return (new (_arg1)());
        }

    }
}//package org.aswing 
